package com.lq.educationsystem.student.feign;

import com.lq.educationsystem.common.entiy.AdminTb;
import com.lq.educationsystem.common.util.Result;
import com.lq.educationsystem.common.util.ResultPage;
import com.lq.educationsystem.common.vo.AdminPageVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 管理员信息的公共api
 */
@Component
@FeignClient(name = "lq-admin")
public interface AdminFeign {
    //通过id查询用户信息
    @GetMapping("/admin/base/querybyid/{adminId}")
    public Result queryById(@PathVariable("adminId") int adminId);

    //新增用户信息
    @RequestMapping("/admin/base/insert")
    public Result insertAdmin(@RequestBody AdminTb adminTb);

    //更新信息
    @RequestMapping("/admin/base/update")
    public Result updateAdminInfo(@RequestBody AdminTb adminTb);

    //删除信息
    @RequestMapping("/admin/base/delete")
    public Result deleteAdminInfo(@RequestBody AdminTb adminTb);

    @RequestMapping("/admin/base/query")
    public ResultPage<AdminTb> queryList(@RequestBody AdminPageVo adminPageVo);
}
